package com.bwda.dsrs.systemservice.mapper;

import com.bwda.dsrs.systemservice.domain.form.menu.MenuTreeForm;
import com.bwda.dsrs.systemservice.domain.po.menu.MenuPo;
import com.bwda.dsrs.systemservice.domain.condition.menu.MenuCondition;

import java.util.List;

/**
 * @author zhangyinmei
 */
public interface MenuMapper extends BaseMapper<MenuPo, MenuCondition> {

    /**
     * 查询菜单树
     * @param menuCondition
     * @return
     */
    List<MenuTreeForm> queryTreeList(MenuCondition menuCondition);

    /**
     * 查询统计排序相邻的菜单
     * @param condition
     * menuId
     * up true：排序值小于当前菜单  down：排序值大于当前菜单
     * @return
     */
    public MenuPo selectNearMenu(MenuCondition condition);

    /**
     * 交换排序
     * @param mecondition
     * @return
     */
    public int exchangeSortNum(MenuCondition mecondition);


    /**
     * 查询重名
     * @param condition
     * @return
     */
    int   countByName(MenuCondition condition);

}